﻿using System.Web.Optimization;

namespace CloudFranceTriple.WebRole
{
    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            // Version VS 2012
            var jqueryCdnPath = "http://code.jquery.com/jquery-1.8.2.min.js";
            var jqueryUICdnPath = "http://code.jquery.com/ui/1.8.24/jquery-ui.min.js";
            var jqueryMobileCdnPath = "http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js";
            var jqueryUIMobileCdnPath = "http://code.jquery.com/ui/1.8.24/jquery-ui.min.js";

            //var jqueryCssCdnPath = "http://code.jquery.com/ui/1.8.24/themes/smoothness/jquery-ui.css";
            //var jqueryCssCdnPath = "http://code.jquery.com/ui/1.8.24/themes/ui-darkness/jquery-ui.css";
            var jqueryCssCdnPath = "http://code.jquery.com/ui/1.8.24/themes/trontastic/jquery-ui.css";

            // Version actuelle qui ne fonctionne pas !
            //var jqueryCdnPath = "http://code.jquery.com/jquery-1.9.1.min.js";
            //var jqueryUICdnPath = "http://code.jquery.com/ui/1.10.3/jquery-ui.min.js";
            //var jqueryMobileCdnPath = "http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js";
            //var jqueryUIMobileCdnPath = "http://code.jquery.com/ui/1.10.3/jquery-ui.min.js";
            //var jqueryCssCdnPath = "http://code.jquery.com/ui/1.10.3/themes/trontastic/jquery-ui.css";

            var jqueryCssMobileWithoutThemeCdnPath = " http://code.jquery.com/mobile/1.3.2/jquery.mobile.structure-1.3.2.min.css";


            bundles.UseCdn = true;

            bundles.Add(new ScriptBundle("~/bundles/jquery", jqueryCdnPath));
            bundles.Add(new ScriptBundle("~/bundles/jqueryui", jqueryUICdnPath));

            bundles.Add(new ScriptBundle("~/bundles/jquery/mobile", jqueryMobileCdnPath));
            bundles.Add(new ScriptBundle("~/bundles/jqueryui/mobile", jqueryUIMobileCdnPath));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));

            bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

            bundles.Add(new StyleBundle("~/Content/themes", jqueryCssCdnPath));
            bundles.Add(new StyleBundle("~/Content/themes/mobile", jqueryCssMobileWithoutThemeCdnPath));

            //bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
            //            "~/Content/themes/base/jquery.ui.core.css",
            //            "~/Content/themes/base/jquery.ui.resizable.css",
            //            "~/Content/themes/base/jquery.ui.selectable.css",
            //            "~/Content/themes/base/jquery.ui.accordion.css",
            //            "~/Content/themes/base/jquery.ui.autocomplete.css",
            //            "~/Content/themes/base/jquery.ui.button.css",
            //            "~/Content/themes/base/jquery.ui.dialog.css",
            //            "~/Content/themes/base/jquery.ui.slider.css",
            //            "~/Content/themes/base/jquery.ui.tabs.css",
            //            "~/Content/themes/base/jquery.ui.datepicker.css",
            //            "~/Content/themes/base/jquery.ui.progressbar.css",
            //            "~/Content/themes/base/jquery.ui.theme.css"));

            BundleTable.EnableOptimizations = true;
        }
    }
}